<template>
	<view>
		<view class="content">
			<view class="formBox">
				<u-tabs-swiper ref="uTabs" :list="list" :current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750" bg-color="transparent"></u-tabs-swiper>
				<view class="search-wrapper"><u-search placeholder="请输入" @search="search" height="70" bg-color="#fff" v-model="listQuery.goodsServerName"></u-search></view>
				<view class="list">
					<view class="item boxShadow">
						<view class="item-title f-c-sb">
							<view>深圳市行知网络科技有限公司 演示店</view>
							<u-checkbox size="50" @change="checkboxChange" v-model="all"></u-checkbox>
						</view>
						<view class="info">
							深圳市南山区粤海大道高新区南区科技南十二路长虹科技大厦1011室 演示店
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {findCoupon, } from '@/api/index.js'
	import {mapGetters,mapMutations} from 'vuex'
	export default {
		data() {
			return {
				tabindex:1,
				list: [
					{
						name: '实物',
						value: '实物',
						type: 'status'
					},
					{
						name: '卡卷',
						value: '卡卷',
						type: 'status'
					},
					{
						name: '套餐',
						value: '套餐',
						type: 'delFlag'
					}
				],
				current:0,
				listQuery: {
					pageNo: 1,
					pageSize: 20,
					noData:true,
					goodsType:1,
					goodsServerName:''
				},
				storeList:[]
			};
		},
    computed: {
      ...mapGetters(['userInfo', 'selectCoupons', 'selectCouponsStr'])
    },
    onLoad() {
      this.init();
      if (this.selectCoupons.length != 0) {
        this.selectList = this.selectCoupons;
      } else if (this.selectCoupons.length == 0 && this.selectCouponsStr) {
        this.getSelectList();
      }
    },
		methods:{
			init(){
				this.getlist()
			},
			getlist(){
					this.listQuery.storeId=this.userInfo.storeBasicId
				findCoupon(this.listQuery).then(res=>{
					console.log(res)
					if(this.listQuery.pageNo==1){
						this.storeList = res.data;
					}else{
						this.storeList = this.storeList.concat(res.data);
					}
					this.listQuery.pageNo+=1
					if(this.listQuery.pageSize!=res.data.length){
						this.listQuery.noData=false
					}
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.content{
		padding-top: 20rpx;
		.formBox{
			padding: 0 0 20rpx 0;
			background-color:transparent ;
			box-shadow: 0 0 0 0 ;
			.tab-wrapper{
				width: 100%;
				view{
					width: 350rpx;
					height: 98rpx;
					background: #eaf3ff;
					font-size: 24rpx;
					font-weight: 700;
					text-align: left;
					color: #177fff;
					text-align: center;
					line-height: 98rpx;
					&.active{
						font-size: 30rpx;
						background-color: #fff;
					}
				}
				
			}
			.search-wrapper{
				width: 100%;
				padding: 20rpx;
				box-sizing: border-box;
			}
			.list{
				width: 100%;
				.item{
					width: 660rpx;
					height: 231rpx;
					background: #ffffff;
					border-radius: 18rpx;
					margin: 23rpx auto;
					padding: 30rpx;
					box-sizing: border-box;
					.color{
						width: 110rpx;
						height: 36rpx;
						opacity: 1;
						background: #177fff;
						border-radius: 6rpx;
						font-size: 24rpx;
						font-weight: 700;
						text-align: center;
						color: #ffffff;
						line-height: 36rpx;
						margin-left: 18rpx;
						&.color1{
							background: #177fff;
						}
						&.color2{
							background: #ff6738;

						}
						&.color3{
							background: #f54170;
						}
						&.color4{
							background: #2db2ad;
						}
					}
				}
				.item-title{
					font-size: 28rpx;
					font-weight: 700;
					color: #131313;
					margin: 20rpx 0;
				}
				.info{
					font-size: 24rpx;
					font-weight: 500;
					color: #666666;
					line-height: 36rpx;
				}
			}
		}

	}
</style>
